﻿<Window x:Class="Main"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cards="clr-namespace:ZuneCardr.Cards"
    Title="ZuneCardr" Height="440" Width="600" ResizeMode="CanMinimize" 
    Icon="/ZuneCardr;component/ZuneCardr.ico" WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <!-- Zune Devices -->
        <VisualBrush x:Key="Device" Stretch="Uniform">
            <VisualBrush.Visual>
                <Canvas Width="20" Height="36">
                    <Rectangle Height="36" Width="20" Fill="{DynamicResource ZuneColour}" Canvas.Left="0" Canvas.Top="0" RadiusX="1" RadiusY="1">
                        <Rectangle.BitmapEffect>
                            <OuterGlowBitmapEffect GlowColor="Black" GlowSize="2" />
                        </Rectangle.BitmapEffect>
                    </Rectangle>
                    <Rectangle Fill="{DynamicResource ZuneScreen}" Canvas.Left="1" Canvas.Top="1" Height="24" Stroke="#191616" Width="18"/>
                    <Rectangle Canvas.Left="5.5" Canvas.Top="25" Height="9" Width="9" RadiusX="3" RadiusY="3" Fill="{DynamicResource ZunePad}" Stroke="{DynamicResource ZunePadOuter}"/>
                </Canvas>
            </VisualBrush.Visual>
        </VisualBrush>
        <VisualBrush x:Key="Keel" Stretch="Uniform">
            <VisualBrush.Visual>
                <Canvas Width="21" Height="36">
                    <Rectangle Height="36" Width="21" Fill="{DynamicResource ZuneColour}" Canvas.Left="0" Canvas.Top="0" RadiusX="1" RadiusY="1">
                        <Rectangle.BitmapEffect>
                            <OuterGlowBitmapEffect GlowColor="Black" GlowSize="2" />
                        </Rectangle.BitmapEffect>
                    </Rectangle>
                    <Rectangle Canvas.Left="1" Canvas.Top="1" Fill="{DynamicResource ZuneScreen}" Height="24" Stroke="#5D5D5D" Width="19" />
                    <Ellipse Canvas.Left="5" Canvas.Top="24" Fill="{DynamicResource ZuneKeel}" Stroke="#5D5D5D" StrokeThickness="1.5" Height="11" Width="11"/>
                </Canvas>
            </VisualBrush.Visual>
        </VisualBrush>
        <VisualBrush x:Key="Draco" Stretch="Uniform">
            <VisualBrush.Visual>
                <Canvas Width="20" Height="36">
                    <Rectangle Height="36" Width="20" Fill="{DynamicResource ZuneColour}" Canvas.Left="0" Canvas.Top="0" RadiusX="1" RadiusY="1">
                        <Rectangle.BitmapEffect>
                            <OuterGlowBitmapEffect GlowColor="Black" GlowSize="2" />
                        </Rectangle.BitmapEffect>
                    </Rectangle>
                    <Rectangle Fill="{DynamicResource ZuneScreen}" Canvas.Left="1" Canvas.Top="1" Height="24" Stroke="#191616" Width="18"/>
                    <Rectangle Canvas.Left="5.5" Canvas.Top="25" Height="9" Width="9" RadiusX="3" RadiusY="3" Fill="{DynamicResource ZunePad}" Stroke="{DynamicResource ZunePadOuter}"/>
                </Canvas>
            </VisualBrush.Visual>
        </VisualBrush>
        <VisualBrush x:Key="Scorpius" Stretch="Uniform">
            <VisualBrush.Visual>
                <Canvas Width="16" Height="35">
                    <Rectangle Height="35" Width="16" Fill="{DynamicResource ZuneColour}" Canvas.Left="0" Canvas.Top="0">
                        <Rectangle.BitmapEffect>
                            <OuterGlowBitmapEffect GlowColor="Black" GlowSize="2" />
                        </Rectangle.BitmapEffect>
                    </Rectangle>
                    <Rectangle Canvas.Left="1" Canvas.Top="1" Fill="{DynamicResource ZuneScreen}" Height="18" Stroke="#191616" Width="14" />
                    <Rectangle Canvas.Left="3" Canvas.Top="22" Fill="{DynamicResource ZunePad}" Stroke="{DynamicResource ZunePadOuter}" Height="10" Width="10" RadiusX="3" RadiusY="3"/>
                </Canvas>
            </VisualBrush.Visual>
        </VisualBrush>
        <!-- Data Templates -->     
        <DataTemplate x:Key="PlaylistData">
            <Border Padding="2">
                <StackPanel Orientation="Horizontal">
                    <Canvas Height="72" Width="72">
                        <Image Source="{Binding Path=Album.ImageLarge}" Height="72" Width="72" Stretch="Fill">
                            <Image.ToolTip>
                                <Image Source="{Binding Path=Album.ImageLarge}" Height="150" Width="150" Stretch="Fill"/>
                            </Image.ToolTip>
                        </Image>
                        <CheckBox IsChecked="{Binding Path=Selected,Mode=TwoWay}" Canvas.Bottom="0" Canvas.Right="0"/>
                    </Canvas>
                    <Canvas Width="4"/>
                    <StackPanel Orientation="Vertical">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/>
                            <TextBlock Text=" by "/>
                            <TextBlock Text="{Binding Path=Album.Artist.Name}"/>
                        </StackPanel>
                        <TextBlock Text="{Binding Path=Album.Name}"/>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Path=Genre}" FontWeight="Bold"/>
                            <TextBlock Text=" ("/>
                            <TextBlock Text="{Binding Path=Album.Release}"/>
                            <TextBlock Text=") "/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Name="Album" xml:space="preserve"><Hyperlink NavigateUri="{Binding Path=Album.URL}" RequestNavigate="HandleRequestNavigate">Album Page</Hyperlink> , </TextBlock>
                            <TextBlock Name="Artist" xml:space="preserve"><Hyperlink NavigateUri="{Binding Path=Album.Artist.URL}" RequestNavigate="HandleRequestNavigate">Artist Page</Hyperlink> , </TextBlock>
                            <TextBlock Name="Send" xml:space="preserve"><Hyperlink NavigateUri="{Binding Path=SendURL}" RequestNavigate="HandleRequestNavigate">Send</Hyperlink></TextBlock>
                            <TextBlock Name="Buy" xml:space="preserve"> , <Hyperlink NavigateUri="{Binding Path=BuyURL}" RequestNavigate="HandleRequestNavigate">Buy</Hyperlink></TextBlock>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </Border>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Path=Album.Artist.URL}" Value="">
                    <Setter TargetName="Artist" Property="Visibility" Value="Collapsed"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=Album.URL}" Value="">
                    <Setter TargetName="Album" Property="Visibility" Value="Collapsed"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=SendURL}" Value="">
                    <Setter TargetName="Send" Property="Visibility" Value="Collapsed"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=BuyURL}" Value="">
                    <Setter TargetName="Buy" Property="Visibility" Value="Collapsed"/>
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
        <DataTemplate x:Key="ArtistData">
            <Border Padding="2">
                <StackPanel Orientation="Horizontal">
                    <Canvas Height="72" Width="72">
                        <Image Source="{Binding Path=ImageLarge}" Height="72" Width="72" Stretch="Uniform">
                            <Image.ToolTip>
                                <Image Source="{Binding Path=ImageLarge}" Height="150" Width="150" Stretch="Uniform"/>
                            </Image.ToolTip>
                        </Image>
                        <CheckBox IsChecked="{Binding Path=Selected,Mode=TwoWay}" Canvas.Bottom="0" Canvas.Right="0"/>
                    </Canvas>
                    <Canvas Width="4"/>
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/>
                        <TextBlock Text="{Binding Path=PlaysFull}"/>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Name="URL"><Hyperlink NavigateUri="{Binding Path=URL}" RequestNavigate="HandleRequestNavigate">Artist Page</Hyperlink></TextBlock>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </Border>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Path=URL}" Value="">
                    <Setter TargetName="URL" Property="Visibility" Value="Collapsed"/>
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
        <DataTemplate x:Key="BadgeData">
            <Border Padding="2">
                <StackPanel Orientation="Horizontal">
                    <Canvas Height="72" Width="72">
                        <Image Source="{Binding Path=ImageLarge}" Height="72" Width="72" Stretch="Fill"/>
                        <CheckBox IsChecked="{Binding Path=Selected,Mode=TwoWay}" Canvas.Bottom="0" Canvas.Right="0"/>
                    </Canvas>
                    <Canvas Width="4"/>
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/>
                        <TextBlock Text="{Binding Path=Description}"/>
                        <TextBlock Text="{Binding Path=Artist.Name}"/>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Name="URL"><Hyperlink NavigateUri="{Binding Path=Artist.URL}" RequestNavigate="HandleRequestNavigate">Artist Page</Hyperlink></TextBlock>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </Border>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Path=Artist.URL}" Value="">
                    <Setter TargetName="URL" Property="Visibility" Value="Collapsed"/>
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
        <DataTemplate x:Key="AllData">
            <Border Padding="2">
                <StackPanel Orientation="Horizontal">
                    <Canvas Height="72" Width="72">
                        <Image Source="{Binding Path=ImageLarge}" Height="72" Width="72" Stretch="Fill"/>
                        <CheckBox IsChecked="{Binding Path=Selected,Mode=TwoWay}" Canvas.Bottom="0" Canvas.Right="0"/>
                    </Canvas>
                    <Canvas Width="4"/>
                    <StackPanel Orientation="Vertical" Width="170">
                        <TextBlock Text="{Binding Path=Name}" FontWeight="Bold" TextWrapping="WrapWithOverflow"/>
                    </StackPanel>
                </StackPanel>
            </Border>
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <Canvas Height="40" VerticalAlignment="Bottom">
            <Button Canvas.Left="6" Canvas.Top="8" Height="23" Name="btnAbout" Width="75">_About...</Button>
            <Button Canvas.Left="350" Canvas.Top="8" Height="23" Name="btnBack" Width="75">_Back</Button>
            <Button Canvas.Left="431" Canvas.Top="8" Height="23" Name="btnNext" Width="75" IsDefault="True">_Next</Button>
            <Button Canvas.Left="512" Canvas.Top="8" Height="23" Name="btnCancel" Width="75" IsCancel="True">_Cancel</Button>
            <TextBlock Canvas.Left="87" Canvas.Top="11" Height="18" Padding="0" Width="84"><Hyperlink NavigateUri="http://www.zunecardr.com" RequestNavigate="HandleRequestNavigate">ZuneCardr.com</Hyperlink></TextBlock>
        </Canvas>
        <Canvas Height="50" VerticalAlignment="Top">
            <Image Name="ProfileAvatar" Canvas.Right="0" Canvas.Top="0" Height="50" Stretch="Fill" Width="50"/>
            <Canvas Name="cvsStepOne" Width="566" Height="300" Canvas.Left="14" Canvas.Top="56">
                <Label Canvas.Left="6" Canvas.Top="6" Height="28" Foreground="#FF585858" Width="554" FontSize="14" FontWeight="Bold">Enter Zune Tag below then select Next to get Zune Card Information</Label>
                <TextBox Canvas.Left="6" Canvas.Top="40" Height="23" Name="ZuneTag" Width="554">
                    <TextBox.Style>
                        <Style TargetType="{x:Type TextBox}">
                            <Style.Triggers>
                                <MultiTrigger>
                                    <MultiTrigger.Conditions>
                                        <Condition Property="Text" Value=""/>
                                        <Condition Property="IsKeyboardFocusWithin" Value="False"/>
                                    </MultiTrigger.Conditions>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                                <TextBox Text="Type Zune Tag here, including any Spaces" Foreground="DimGray" Background="{TemplateBinding Background}" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}" />
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </MultiTrigger>
                            </Style.Triggers>
                        </Style>
                    </TextBox.Style>
                </TextBox>
                <TextBlock Canvas.Left="6" Canvas.Top="69" Height="28" Foreground="DimGray" Width="554">Examples: <Hyperlink Style="{StaticResource TagHyperlink}" RequestNavigate="HandleRequestTag" NavigateUri="RoguePlanetoid">RoguePlanetoid</Hyperlink>, <Hyperlink Style="{StaticResource TagHyperlink}" RequestNavigate="HandleRequestTag" NavigateUri="MossyRoc">MossyRoc</Hyperlink> , <Hyperlink Style="{StaticResource TagHyperlink}" RequestNavigate="HandleRequestTag" NavigateUri="Major Nelson">Major Nelson</Hyperlink></TextBlock>
                <GroupBox Canvas.Left="6" Canvas.Top="95" Header="Progress" Height="123" Name="Progress" Width="554" Visibility="Hidden">
                    <Grid>
                        <Label HorizontalAlignment="Left" Margin="6,6,0,43.04" Width="84">Downloading</Label>
                        <Label Name="Downloading" Margin="0,6,6,0" Height="28" VerticalAlignment="Top" FontWeight="Bold" HorizontalAlignment="Right" Width="440">Pending</Label>
                        <Label HorizontalAlignment="Left" Margin="6,29,0,43.04" Width="84">Processing</Label>
                        <Label Name="Processing" FontWeight="Bold" Margin="96,29,6,43.04">Pending</Label>
                        <Button Height="23" HorizontalAlignment="Left" Margin="15,0,0,14" Name="btnDetails" VerticalAlignment="Bottom" Width="75">Details...</Button>
                        <Label Foreground="DimGray" Height="28" Margin="96,0,6,9" VerticalAlignment="Bottom">Problems Downloading? Check your Firewall allows ZuneCardr Internet Access</Label>
                    </Grid>
                </GroupBox>
                <TextBlock Foreground="DimGray" Height="30" Padding="5" Canvas.Left="6" Canvas.Top="265" Width="554">
                    Visit the <Hyperlink NavigateUri="http://www.zune.net" RequestNavigate="HandleRequestNavigate">Zune Homepage</Hyperlink> or <Hyperlink NavigateUri="http://social.zune.net" RequestNavigate="HandleRequestNavigate">Zune Social</Hyperlink> to find out more about Zune Cards and Zune Users
                </TextBlock>
            </Canvas>
            <Label Canvas.Left="6" Canvas.Top="6" Height="44" Width="152" FontSize="28" Padding="3" FontWeight="Bold" FontFamily="Arial" Content="ZuneCardr">
            <Label.Foreground><LinearGradientBrush><GradientStop Offset="1" Color="#FF0099"/><GradientStop Offset="0" Color="#FF6600"/></LinearGradientBrush></Label.Foreground></Label>
            <Label Name="ProfileTag" Canvas.Left="156" Canvas.Top="9" FontSize="28" Height="36" Padding="0" Width="366" FontFamily="Arial" Foreground="#FF585858" Content="{DynamicResource ZuneTag}"/>
            <Canvas Name="cvsStepTwo" Height="300" Width="566" Canvas.Left="578" Canvas.Top="56">
                <Label Canvas.Left="6" Canvas.Top="6" FontSize="14" FontWeight="Bold" Foreground="#FF585858" Height="28" Width="554">Select Images from Playlists, Artists or Badges to display on the Zune Card</Label>
                <TabControl Name="Lists" Canvas.Left="6" Canvas.Top="40" Height="219" Width="554">
                    <TabItem Header="Favourites" Name="Favourites">
                        <Grid>
                            <ListBox Name="lstFavourites" ItemTemplate="{DynamicResource PlaylistData}">
                                <ListBox.Resources>
                                    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Gray"/>
                                </ListBox.Resources>
                            </ListBox>
                            <TextBlock Name="txtFavourites" HorizontalAlignment="Center" Visibility="Hidden"/>
                        </Grid>
                    </TabItem>
                    <TabItem Header="Recent" Name="Recent">
                        <Grid>
                            <ListBox Name="lstRecent" ItemTemplate="{DynamicResource PlaylistData}">
                                <ListBox.Resources>
                                    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Gray"/>
                                </ListBox.Resources>
                            </ListBox>
                            <TextBlock Name="txtRecent" HorizontalAlignment="Center" Visibility="Hidden"/>
                        </Grid>
                    </TabItem>
                    <TabItem Header="Artists" Name="Artists">
                        <Grid>
                            <ListBox Name="lstArtists" ItemTemplate="{DynamicResource ArtistData}">
                                <ListBox.Resources>
                                    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Gray"/>
                                </ListBox.Resources>
                            </ListBox>
                            <TextBlock Name="txtArtists" HorizontalAlignment="Center" Visibility="Hidden"/>
                        </Grid>
                    </TabItem>
                    <TabItem Header="Badges" Name="Badges">
                        <Grid>
                            <ListBox Name="lstBadges" ItemTemplate="{DynamicResource BadgeData}">
                                <ListBox.Resources>
                                    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Gray"/>
                                </ListBox.Resources>
                            </ListBox>
                            <TextBlock Name="txtBadges" HorizontalAlignment="Center" Visibility="Hidden"/>
                        </Grid>
                    </TabItem>
                    <TabItem Header="All" Name="All">
                        <Grid>
                            <ListBox Name="lstAll" ItemTemplate="{DynamicResource AllData}" Style="{StaticResource IconView}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                                <ListBox.Resources>
                                    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Gray"/>
                                </ListBox.Resources>
                            </ListBox>
                            <TextBlock Name="txtAll" HorizontalAlignment="Center" Visibility="Hidden"/>
                        </Grid>
                    </TabItem>
                    <TabItem Header="Profile" Name="Profile">
                        <Grid>
                            <TextBlock Canvas.Left="336" Canvas.Top="32" Padding="0" FlowDirection="LeftToRight" Margin="6,4,6,0" Height="18.04" VerticalAlignment="Top">
                            <Hyperlink Name="ProfileHome" RequestNavigate="HandleRequestNavigate">Home</Hyperlink> , 
                            <Hyperlink Name="ProfileSend" RequestNavigate="HandleRequestNavigate">Send Card</Hyperlink> , 
                            <Hyperlink Name="ProfileMessage" RequestNavigate="HandleRequestNavigate">Send Message</Hyperlink></TextBlock>
                            <TextBlock Height="21" Margin="6,24,6,0" VerticalAlignment="Top" Text="{DynamicResource Location}" />
                            <TextBlock Margin="6,47,6,42" Text="{DynamicResource Biography}" TextWrapping="Wrap" />
                        </Grid>
                    </TabItem>
                </TabControl>
                <Label Canvas.Left="0" Canvas.Top="265" Foreground="DimGray" Height="28" Width="560">Tick the boxes to use Images on the Zune Card, up to the maximum to be displayed on the Zune Card.</Label>
            </Canvas>
        <Canvas Name="cvsStepThree" Canvas.Left="6" Width="566" Height="300" Canvas.Top="360">
            <Label Canvas.Left="6" Canvas.Top="6" FontSize="14" FontWeight="Bold" Foreground="#FF585858" Height="28" Width="554">Select Style and Options, then Save or Copy the completed Zune Card</Label>
            <ComboBox Canvas.Left="6" Canvas.Top="40" Height="23" Name="cboStyle" Width="554" IsReadOnly="True">
                <ComboBoxItem>Small Card</ComboBoxItem>
            </ComboBox>
            <ComboBox Width="90" Height="25" Name="cboSource" Canvas.Left="6" Canvas.Top="69" IsReadOnly="True">
                <ComboBoxItem>Favourites</ComboBoxItem>
            </ComboBox>
            <Menu Canvas.Left="102" Canvas.Top="69" Height="25" Width="458">
                <MenuItem Header="_Settings">
                    <MenuItem Header="_Open..." MenuItem.Click="OpenSettings_Click"/>
                    <MenuItem Header="_Save..." MenuItem.Click="SaveSettings_Click"/>
                    <Separator/>
                    <MenuItem Header="_Custom Style..." MenuItem.Click="Style_Click"/>
                </MenuItem>
                <MenuItem Header="_Display">
                    <MenuItem Header="_Avatar Image" IsCheckable="True" Name="ShowAvatar" MenuItem.Checked="Display_Click" MenuItem.Unchecked="Display_Click"/>
                    <MenuItem Header="_Background Image" IsCheckable="True" Name="ShowBackground" MenuItem.Checked="Display_Click" MenuItem.Unchecked="Display_Click"/>
                    <MenuItem Header="_Cover Images" IsCheckable="True" Name="ShowCovers" MenuItem.Checked="Display_Click" MenuItem.Unchecked="Display_Click"/>
                    <Separator/>
                    <MenuItem Header="Cover _Text" IsCheckable="True" Name="ShowCoverText" MenuItem.Checked="Display_Click" MenuItem.Unchecked="Display_Click"/>
                    <MenuItem Header="_Plays" IsCheckable="True" Name="ShowPlays" MenuItem.Checked="Display_Click" MenuItem.Unchecked="Display_Click"/>
                    <MenuItem Header="Ba_dges" IsCheckable="True" Name="ShowBadges" MenuItem.Checked="Display_Click" MenuItem.Unchecked="Display_Click"/>
                    <MenuItem Header="_Status" IsCheckable="True" Name="ShowStatus" MenuItem.Checked="Display_Click" MenuItem.Unchecked="Display_Click"/>
                    <MenuItem Header="_Last Played" IsCheckable="True" Name="ShowLastPlayed" MenuItem.Checked="Display_Click" MenuItem.Unchecked="Display_Click"/>
                    <MenuItem Header="_Weblink" IsCheckable="True" Name="ShowWeblink" MenuItem.Checked="Display_Click" MenuItem.Unchecked="Display_Click"/>
                    <MenuItem Header="_Zune" IsCheckable="True" Name="ShowZune" MenuItem.Checked="Display_Click" MenuItem.Unchecked="Display_Click"/>
                </MenuItem>
                <MenuItem Header="_Zune">
                        <MenuItem.Resources>
                            <Style x:Key="GroupZune" TargetType="{x:Type RadioButton}">
                                <Setter Property="HorizontalAlignment" Value="Center"/>
                                <Setter Property="GroupName" Value="Zune"/>
                                <Setter Property="IsHitTestVisible" Value="False"/>
                            </Style>
                        </MenuItem.Resources>
                        <MenuItem Header="4GB" Name="Z4GB" MenuItem.Click="Zune_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupZune}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="8GB" Name="Z8GB" MenuItem.Click="Zune_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupZune}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="16GB" Name="Z16GB" MenuItem.Click="Zune_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupZune}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="30GB" Name="Z30GB" MenuItem.Click="Zune_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupZune}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="80GB" Name="Z80GB" MenuItem.Click="Zune_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupZune}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="120GB" Name="Z120GB" MenuItem.Click="Zune_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupZune}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <Separator/>
                        <MenuItem Header="Colour..." MenuItem.Click="ZuneColour_Click">
                            <MenuItem.Icon>
                                <Rectangle Height="16" Width="16" Stroke="Black" Fill="{DynamicResource ZuneColour}"/>
                            </MenuItem.Icon>
                           </MenuItem>
                        </MenuItem>
                <MenuItem Header="_Theme">
                    <MenuItem.Resources>
                        <Style x:Key="GroupTheme" TargetType="{x:Type RadioButton}">
                            <Setter Property="HorizontalAlignment" Value="Center"/>
                            <Setter Property="GroupName" Value="Theme"/>
                            <Setter Property="IsHitTestVisible" Value="False"/>
                        </Style>
                    </MenuItem.Resources>
                    <MenuItem Header="Zune _1.0" Name="T1" MenuItem.Click="Theme_Click">
                        <MenuItem.Icon><RadioButton Style="{StaticResource GroupTheme}" IsChecked="True" /></MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Zune _2.0" Name="T2" MenuItem.Click="Theme_Click">
                        <MenuItem.Icon><RadioButton Style="{StaticResource GroupTheme}" IsChecked="True" /></MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Zune _3.0" Name="T3" MenuItem.Click="Theme_Click">
                        <MenuItem.Icon><RadioButton Style="{StaticResource GroupTheme}" IsChecked="True" /></MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="_Gamer Card" Name="T66" MenuItem.Click="Theme_Click">
                        <MenuItem.Icon><RadioButton Style="{StaticResource GroupTheme}" IsChecked="True" /></MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="_Custom" Name="T99" MenuItem.Click="Theme_Click">
                        <MenuItem.Icon><RadioButton Style="{StaticResource GroupTheme}" IsChecked="True" /></MenuItem.Icon>
                    </MenuItem>
                    <Separator/>
                    <MenuItem Header="Gradient _Start" Name="CGradientStart" MenuItem.Click="Custom_Click"/>
                    <MenuItem Header="Gradient _End" Name="CGradientEnd" MenuItem.Click="Custom_Click"/>
                    <MenuItem Header="_Foreground" Name="CForeground" MenuItem.Click="Custom_Click"/>
                    <MenuItem Header="_Background" Name="CBackground" MenuItem.Click="Custom_Click"/>
                    <MenuItem Header="_Line / Border" Name="CBorder" MenuItem.Click="Custom_Click"/>
                    <MenuItem Header="Section F_oreground" Name="CSectionForeground" MenuItem.Click="Custom_Click"/>
                    <MenuItem Header="Section B_ackground" Name="CSectionBackground" MenuItem.Click="Custom_Click"/>
                    <MenuItem Header="_Item Foreground" Name="CItemForeground" MenuItem.Click="Custom_Click"/>
                </MenuItem>
                    <MenuItem Header="_Card">
                        <MenuItem Header="_Save Image..." MenuItem.Click="Save_Click"/>
                        <MenuItem Header="_Copy Image" MenuItem.Click="Copy_Click"/>
                        <MenuItem Header="_Image Size">
                        <MenuItem.Resources>
                            <Style x:Key="GroupSize" TargetType="{x:Type RadioButton}">
                                <Setter Property="HorizontalAlignment" Value="Center"/>
                                <Setter Property="GroupName" Value="Size"/>
                                <Setter Property="IsHitTestVisible" Value="False"/>
                            </Style>
                        </MenuItem.Resources>
                        <MenuItem Header="50%" Name="S50" MenuItem.Click="Output_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupSize}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="75%" Name="S75" MenuItem.Click="Output_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupSize}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="Normal" Name="S100" MenuItem.Click="Output_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupSize}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="150%" Name="S150" MenuItem.Click="Output_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupSize}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="200%" Name="S200" MenuItem.Click="Output_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupSize}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="300%" Name="S300" MenuItem.Click="Output_Click">
                            <MenuItem.Icon><RadioButton Style="{StaticResource GroupSize}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="400%" Name="S400" MenuItem.Click="Output_Click">
                                <MenuItem.Icon><RadioButton Style="{StaticResource GroupSize}" IsChecked="True" /></MenuItem.Icon>
                        </MenuItem>
                        </MenuItem>
                        <Separator/>
                        <MenuItem Header="Copy _Weblink" MenuItem.Click="CopyWeblink_Click"/>
                    </MenuItem>
                </Menu>
                <ScrollViewer Canvas.Left="6" Canvas.Top="100" Height="194" Width="554" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                    <Grid VerticalAlignment="Top" HorizontalAlignment="Left" Name="CardPreview"/>
                </ScrollViewer>
            </Canvas>
        </Canvas>
    </Grid>
</Window>